﻿<views:MvxWpfView 
    x:Class="Sidvall.FileSystemManager.UI.Wpf.Views.RenameConfigView"
    xmlns:views="clr-namespace:MvvmCross.Wpf.Views;assembly=MvvmCross.Wpf"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters;assembly=Sidvall.UI.Wpf"
    xmlns:vms="clr-namespace:Sidvall.FileSystemManager.UI.ViewModels;assembly=Sidvall.FileSystemManager.UI"
    xmlns:Controls="clr-namespace:Sidvall.FileSystemManager.UI.Wpf.Controls"
    mc:Ignorable="d" 
    d:DesignHeight="400" d:DesignWidth="600">

    <views:MvxWpfView.Resources>
        <Converters:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
    </views:MvxWpfView.Resources>

    <Grid d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vms:RenameConfigViewModel}}" IsEnabled="{Binding IsBusy, Converter={StaticResource InverseBooleanConverter}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Controls:HeaderControl HeaderCaption="Rename" HeaderHorizontalContentAlignment="Center" FontSize="14" FontWeight="Bold"/>

        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Label Content="Root Folder:"/>
                <TextBox Grid.Column="1" Text="{Binding ActiveEntity.FolderPath}" />

                <Label Grid.Row="1" Content="Old Name(s):"/>
                <Grid Grid.Row="1" Grid.Column="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <ComboBox Grid.Column="0" IsEditable="True" ItemsSource="{Binding OldPathNames1}" DisplayMemberPath="Name" SelectedValuePath="Name" Text="{Binding ActiveEntity.OldName1}" />
                    <ComboBox Grid.Column="1" IsEditable="True" ItemsSource="{Binding OldPathNames2}" DisplayMemberPath="Name" SelectedValuePath="Name" Text="{Binding ActiveEntity.OldName2}" />
                    <ComboBox Grid.Column="2" IsEditable="True" ItemsSource="{Binding OldPathNames3}" DisplayMemberPath="Name" SelectedValuePath="Name" Text="{Binding ActiveEntity.OldName3}" />
                </Grid>

                <Label Grid.Row="2" Content="New Name(s):"/>
                <Grid Grid.Row="2" Grid.Column="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <ComboBox Grid.Column="0" IsEditable="True" ItemsSource="{Binding NewPathNames1}" DisplayMemberPath="Name" SelectedValuePath="Name" Text="{Binding ActiveEntity.NewName1}" />
                    <ComboBox Grid.Column="1" IsEditable="True" ItemsSource="{Binding NewPathNames2}" DisplayMemberPath="Name" SelectedValuePath="Name" Text="{Binding ActiveEntity.NewName2}" />
                    <ComboBox Grid.Column="2" IsEditable="True" ItemsSource="{Binding NewPathNames3}" DisplayMemberPath="Name" SelectedValuePath="Name" Text="{Binding ActiveEntity.NewName3}" />
                </Grid>


                <Label Grid.Row="3" Content="Include Patterns:"/>
                <ComboBox Grid.Row="3" Grid.Column="1" IsEditable="True" ItemsSource="{Binding SearchPatterns}" DisplayMemberPath="Name" SelectedValuePath="Name" Text="{Binding ActiveEntity.SearchPatterns}" ToolTip="Separator = pipeline (|)" />

                <CheckBox Grid.Row="4" Grid.Column="1" IsChecked="{Binding ActiveEntity.RenameFolders}" VerticalAlignment="Center" HorizontalAlignment="Left"
                          Margin="0,5,0,0">Rename Folders</CheckBox>
                <CheckBox Grid.Row="5" Grid.Column="1" IsChecked="{Binding ActiveEntity.RecursiveFolders}" VerticalAlignment="Center" HorizontalAlignment="Left"
                          Margin="0,5,0,0">Recursive Folders</CheckBox>
                <CheckBox Grid.Row="6" Grid.Column="1" IsChecked="{Binding ActiveEntity.RenameFiles}" VerticalAlignment="Center" HorizontalAlignment="Left"
                          Margin="0,5,0,0">Rename Files</CheckBox>
                <CheckBox Grid.Row="7" Grid.Column="1" IsChecked="{Binding ActiveEntity.UpdateFileContents}" VerticalAlignment="Center" HorizontalAlignment="Left"
                          Margin="0,5,0,0">Update Files Content</CheckBox>
                <CheckBox Grid.Row="8" Grid.Column="1" IsChecked="{Binding ActiveEntity.CaseSensitive}" VerticalAlignment="Center" HorizontalAlignment="Left"
                          Margin="0,5,0,0">Case Sensitive</CheckBox>
            </Grid>
            <Grid Grid.Column="1" Margin="5,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Button Grid.Row="0" Width="120" Height="36" Command="{Binding SetRenameCommand}" Content="Set Default" />
                <Button Grid.Row="1" Width="120" Height="36" Command="{Binding SetRenameNumberCommand}" Content="Set Number" Margin="0,10,0,0"/>
            </Grid>
        </Grid>
        <StackPanel Grid.Row="3" Orientation="Horizontal">
            <Button Width="100" Height="36" Command="{Binding RenameCommand}" Content="Rename"/>
        </StackPanel>
    </Grid>
</views:MvxWpfView>
